import { createRouter, createWebHashHistory } from "vue-router";

const router = createRouter({
    history: createWebHashHistory(),
    routes: [
        {
            path: '/',
            name: 'index',
            component: () => import("@/layout/index.vue"),
            children: [
                {
                    path: '/dashboard/console',
                    name: 'dashboard-console',
                    component: () => import("@/views/dashboard/console/index.vue")
                },
                {
                    path: '/dashboard/monitor',
                    name: 'dashboard-monitor',
                    component: () => import("@/views/dashboard/monitor/index.vue")
                },
                {
                    path: '/dashboard/workplace',
                    name: 'dashboard-workplace',
                    component: () => import("@/views/dashboard/workplace/index.vue")
                },
                {
                    path: "/system/menu",
                    name: "system-menu",
                    component: () => import("@/views/system/menu/index.vue"),
                  },
                  {
                    path: "/system/user",
                    name: "system-user",
                    component: () => import("@/views/system/user/index.vue"),
                  },
                  {
                    path: "/system/role",
                    name: "system-role",
                    component: () => import("@/views/system/role/index.vue"),
                  },
                {
                    path: "/examples/tree",
                    name: "examples-tree",
                    component: () => import("@/views/examples/tree/index.vue"),
                },
            ],
        },
        {
            path: '/login',
            name: 'login',
            component: () => import("@/views/login/index.vue")
        },


    ],
});

// const whiteNames = ["login"]
// router.beforeEach((toString,from)=>{
//     const token = getToken()
// })

export default router